package com.heima.admin.controller.v1;

import com.heima.admin.service.ArticleReviewService;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/api/v1/news")
@RestController
public class ArticleReviewController {

    @Autowired
    private ArticleReviewService articleReviewService;

    @PostMapping("auth_fail")
    public ResponseResult rewiew(Integer id ,String msg){
        articleReviewService.review(id, msg);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }

    @PostMapping("/auth_pass")
    public ResponseResult rewiewPass(Integer id){
        articleReviewService.reviewPass(id);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }
}
